class FirstPage extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            list: [
                { ismode: 1 },
            ],
            thumburl: '',
            name: '',
            fangjianhtml: [],
            input_name: '',
            sdarr: [],
            showpage:!1,
            sel_fang: -1,
            showpage1:!1,
            mbkjlist: [

            ],//模板空间
            id: '0',
            partcount: 1,
            parts: [{ src: '' }, { src: '' }, { src: '' }],
            categorylist: [],
            select_swiperlink: { name: '请选择' },
            swiperimglist: [],
            input_mbname: '模板房间',
            category_select_list: [],
            recommendtablehtml: [],
            recommendlist: [],
            detail: { id: -1, name: '' },
            goods_select_html: [],
            currentswipertype: 0,
            swiperlinkhtml: [],
            swipertablehtml: [],
            swiperimghtml: [],
            subtitle: '',
            totalamount: 0,
            showmoban: !1,
            moban: {
                cp: [
                    { width: 0, height: 0, deep: 0, singleprice: 0 }
                ],
                wj: [
                    { count: 0, singleprice: 0 }

                ],
                name: '',
                amount: 0
            },
            exportlist: [

            ],
            // exportlist1:[
            //     {
            //         room:{
            //             name:'',
            //             id:''
            //         },
            //         wjtotal:0,
            //         cptotal:0,
            //         cptotalcount:0,
            //         amount:0,
            //         wj:[{
            //             pid: '',
            //             cid: '-1',
            //             cid1: '-1',
            //             cname: '',
            //             height: "",
            //             width: "",
            //             deep: "",
            //             singleprice: 0,
            //             count: '',
            //             amount: '',
            //             unit: '',
            //             lmsm: '',
            //             mbcz: '',
            //             gtcz: '',
            //         }

            //         ],
            //         cp:[
            //             {
            //                 pid: '',
            //                 cid: '-1',
            //                 cid1: '-1',
            //                 cname: '',
            //                 height: "",
            //                 width: "",
            //                 deep: "",
            //                 singleprice: 0,
            //                 count: '',
            //                 amount: '',
            //                 unit: '',
            //                 lmsm: '',
            //                 mbcz: '',
            //                 gtcz: '',

            //             }
            //         ]
            //     }
            // ],
            swiper: {
                imgs: [],
                links: []
            },
            fileimgshow: !0,
            imgstate: '',
            imgsrc: '',
            to: '',
        };
    }

    formatlist(list) {
        console.log('1232345234');
        list.forEach((x, i) => {
            if (!x.items['cp']) {
                // console.log("x.items['cp']");
                let items = {}
                items['cp'] = x.items.filter(x => { return x.type == 'CP' })
                items['wj'] = x.items.filter(x => { return x.type == 'WJ' })
                list[i]['items'] = items
            }
        })
        console.log(list, 'format--list');
        this.setState({ exportlist: list })
    }


    getxs(deep) {

        let ii=-1,{sdarr} = this.state;
        this.state.sdarr.forEach((x,i) => {
            if (deep > x.min && deep <= x.max) ii = i
        })
        let res = ii==-1?1:sdarr[ii].number
       // console.log({deep,res},'getxs');

        return res;
    }

    firstgetdata(id){
        let  totalamount = 0, fangjianhtml = []
        dzroom_getlist(res => {
            if (res.issuccess == 1) {
                fangjianhtml.push(<option value={-1}>请选择 </option>)
                res.list.forEach((x, i) => {
                    fangjianhtml.push(
                        <option key={i} value={x.id}>{x.name} </option>
                    )
                })
                this.setState({ roomlist: res.list, fangjianhtml })
            }
        })

        dz_categetlist(res => {
            if (res.issuccess == 1) {
                let { list } = res

                let cate_CPLBhtml = [], cate_GTCZhtml = [], cate_WJLBhtml = [], cate_WJCZhtml = [],cate_MBXHhtml=[],cate_LSFShtml=[],cate_GTXHhtml=[];
                let list_CPLB = list.filter(x => x.type == 'CPLB')
                let list_GTCZ = list.filter(x => x.type == 'GTCZ')
                let list_WJLB = list.filter(x => x.type == 'WJLB')
                let list_WJCZ = list.filter(x => x.type == 'WJCZ')
                let list_MBXH = list.filter(x => x.type == 'MBXH')
                let list_LSFS = list.filter(x => x.type == 'LSFS')
                let list_GTXH = list.filter(x => x.type == 'GTXH')
                let list_XSSD = list.filter(x => x.type == 'XSSD')
              //  console.log({ list_CPLB, list_GTCZ, list_WJLB, list_WJCZ }, 'list1');


              cate_LSFShtml.push(<option value={-1}>请选择 </option>)
              list_LSFS.forEach((x, i) => {
                cate_LSFShtml.push(
                      <option key={i} value={x.id}>
                        {x.name} 
                        </option>
                  )
              })

              cate_GTXHhtml.push(<option value={-1}>请选择 </option>)
              list_GTXH.forEach((x, i) => {
                cate_GTXHhtml.push(
                      <option key={i} value={x.id}>{x.name} 
                      </option>
                      
                  )
              })

              cate_MBXHhtml.push(<option value={-1}>请选择 </option>)
              list_MBXH.forEach((x, i) => {
                cate_MBXHhtml.push(
                      <option key={i} value={x.id}>{x.name} 
                      </option>
                  )
              })

                cate_CPLBhtml.push(<option value={-1}>请选择 </option>)
                list_CPLB.forEach((x, i) => {
                    cate_CPLBhtml.push(
                        <option key={i} value={x.id}>{x.name} </option>
                    )
                })

                cate_GTCZhtml.push(<option value={-1}>请选择 </option>)
                list_GTCZ.forEach((x, i) => {
                    cate_GTCZhtml.push(
                        <option key={i} value={x.id}>{x.name} </option>
                    )
                })

                cate_WJLBhtml.push(<option value={-1}>请选择 </option>)
                list_WJLB.forEach((x, i) => {
                    cate_WJLBhtml.push(
                        <option key={i} value={x.id}>{x.name} </option>
                    )
                })

                cate_WJCZhtml.push(<option value={-1}>请选择 </option>)
                list_WJCZ.forEach((x, i) => {
                    cate_WJCZhtml.push(
                        <option key={i} value={x.id}>{x.name} </option>
                    )
                })

                // catehtml1.push(<option value={-1}>请选择</option>)
                // res.list1.forEach((x, i) => {
                //     catehtml1.push(
                //         <option key={i} value={x.id}>{x.name} </option>
                //     )
                
                // })
                if (id != 'null') {
                    this.setState({ id,sdarr:list_XSSD }, () => {
                        dz_projectdetail_getd(id, res => {
                            let detail = res.data
                            // console.log(uniq(res.data.roomids.split(',')),'uniq');
                            if (detail.rawData == '') {
                                dzroom_getlistbyid(
                                    uniq(res.data.roomids.split(',')).toString(), res => {
                                        let { list } = res
                                        if (list.length > 0) {
                                            this.setState({ input_name: res.name })
                                            this.formatlist(list)
                                            // dz_getcategorylist('XSSD', res => {
                                            //     if (res.issuccess == 1) {
                                            //         this.setState({ sdarr: res.list, input_name: res.name }, () => {
                                            //             this.formatlist(list)
                                            //         })
                                            //     }
                                            // })
                                        }
                                    }
                                )
                            } else {
                                // console.log(),'0000');
                                let exportlist = JSON.parse(decodeurl(res.data.rawData))
                                console.log(exportlist, 'listlist123');
                                this.formatlist(exportlist)
        
                                this.setState({ input_name: detail.name })
        
                            }
                        })
                    })
                }




                this.setState({
                    cate_CPLBhtml, list_CPLB, cate_GTCZhtml, list_GTCZ, list_WJLB,list_LSFS,list_GTXH,list_MBXH
                    , cate_WJLBhtml, cate_WJCZhtml, list_WJCZ,cate_MBXHhtml,cate_LSFShtml,cate_GTXHhtml
                })
            }

        })

    }

    ccheck(id){
        this.firstgetdata(id)
    }




    componentDidMount() {
        let id = GetQueryString('id'), totalamount = 0, fangjianhtml = []

        this.ccheck(id)

    }
    freshlist() {
        dzroom_getlist(res => {
            if (res.issuccess == 1) {

                // this.formatlist(res.list); 
                let roomhtml = [];
                roomhtml.push(<option value={-1}>请选择 </option>)
                res.list.forEach(x => {
                    roomhtml.push(
                        <option value={x.id}>{x.name} </option>
                    )
                })

                this.setState({ list: res.list, roomhtml })

                console.log(res.list)
            }
        })




    }





    /**新建 */
    add() {
        // $('.modal1').show()
        var name = prompt('请输入房间名称')
        if (name != '') {
            aoedzroom({ name }, res => {
                if (res.issuccess == 1) {
                    this.freshlist()
                } else {
                    alert(res.msg)
                }
            })
        }
    }


    // 编辑
    edit(x) {
        var name = prompt('请编辑房间名称', x.name)
        if (name != '' && name != x.name) {
            //  console.log(name,'name');

            dz_projectdetail_add({ id: x.id, name }, res => {
                if (res.issuccess == 1) {
                    //   alert('修改成功')
                    this.freshlist()
                } else {
                    alert(res.msg)
                }
            })
        }

        // 
    }
    tosub(x) {
        window.location.href = "./dz_subcate.html?id=" + x.id + "&name=" + x.name;
    }
    // 排序
  


    delroom(index) {
        var b = confirm('确定要删除房间吗')
        if (b) {
            let { exportlist } = this.state
            exportlist.splice(index, 1)
            this.setState({ exportlist })
        }
    }



    confirmdel() {
        let { delid, start } = this.state
        delimg(delid, res => {
            if (res.issuccess == 1) {
                //  alert('删除成功')
                $('#myModal').modal('toggle');
                this.freshlist(start)
            } else {
                $('#myModal').modal('toggle');
                alert(res.msg);
            }
        })
    }

    closemodal() {
        $('.modal1').hide()
    }

    inputchange(prop, e) {
        this.setState({ [prop]: e.target.value })
    }
    confirm() {
        let { name, subtitle } = this.state, err = '';
        if (name.length == 0) err = '请输入名称'
        dz_project_aoe({ name, subtitle }, res => {
            $('.modal1').hide()
            if (res.issuccess == 1) {
                //   alert('提交成功')
                this.freshlist()
            }
        })
    }

    toitem(id) {
        window.location.href = './dz_item.html?id=' + id
    }

    // selectchange(e){
    //     this.setState({selectroomid:e.target.value})
    // }

    selectchange(ei, t, index, e) {
        //  if(this.state.detail.pool!='BJ') return

        let { value } = e.target, { exportlist } = this.state, tname = t == 'CP' ? 'cp' : 'wj', list = t == 'CP' ? this.state.list_GTCZ : this.state.list_WJLB, item = list.find(x => x.id == value), i = 0;
        console.log('here-selectchange', { ei, t, e, index, item });
        // if (id > 0) {
        //     i = exportlist[ei]['items'].findIndex(x => { return x.id == id })
        // } else {
        //     //自定义里的 
        //     // if(t=='WJLB'){
        //     //     index+=exportlist[ei]['items'].filter(x=>{return x.type=='CP'}).length
        //     // }
        //     i = exportlist[ei]['items'].findIndex(x => { return x.oindex == index })
        // }
        //console.log(i, 'selectchange--i');
        exportlist[ei]['items'][tname][index]['cid1'] = item.id;
        exportlist[ei]['items'][tname][index]['type'] = t
        exportlist[ei]['items'][tname][index]['cname1'] = item.name;
        exportlist[ei]['items'][tname][index]['singleprice'] = item.price;
        exportlist[ei]['items'][tname][index]['unit'] = item.unit;
        this.setState({ exportlist }, () => {
            this.save(exportlist)
        })
    }


    selectchange1(ei, t, index, e) {
        //  if(this.state.detail.pool!='BJ') return

        console.log('here-selectchange1', { ei, t, e, index });
        let { value } = e.target, { exportlist } = this.state, tname = 'cp', 
        list =t=='LSFS'? this.state.list_LSFS : 
        t=='GTXH'? this.state.list_GTXH : this.state.list_MBXH, item = list.find(x => x.id == value), i = 0;
        console.log('here-selectchange1', { ei, t, e, index, item });
        // if (id > 0) {
        //     i = exportlist[ei]['items'].findIndex(x => { return x.id == id })
        // } else {
        //     //自定义里的 
        //     // if(t=='WJLB'){
        //     //     index+=exportlist[ei]['items'].filter(x=>{return x.type=='CP'}).length
        //     // }
        //     i = exportlist[ei]['items'].findIndex(x => { return x.oindex == index })
        // }
        //console.log(i, 'selectchange--i');
        exportlist[ei]['items'][tname][index][t+"id"] = item.id;
        exportlist[ei]['items'][tname][index][t+"src"] = item.imgurl;
        exportlist[ei]['items'][tname][index]['type'] = t
        exportlist[ei]['items'][tname][index][t+'name'] = item.name;
        // exportlist[ei]['items'][tname][index]['singleprice'] = item.price;
        // exportlist[ei]['items'][tname][index]['unit'] = item.unit;
        this.setState({ exportlist }, () => {
            this.save(exportlist)
        })
    }


    savemoban() {
        let { input_name } = this.state
        if (input_name == '') {
            alert('请输入业主地址')
            return
        } else {
            let { moban, exportlist } = this.state, data = {
                name: this.state.input_mbname,
                items: {
                    cp: [{ width: 0, height: 0, deep: 0, singleprice: 0 }]
                    , wj: [{ count: 0, singleprice: 0 }]
                }
            }
            exportlist.push(data)
            this.save(exportlist)


            this.setState({
                exportlist, moban: {
                    cp: [
                        { width: 0, height: 0, deep: 0, singleprice: 0 }
                    ],
                    wj: [
                        { count: 0, singleprice: 0 }

                    ],
                    name: '',
                    amount: 0
                }
            })
        }
    }



    export() {



        let { exportlist, detail } = this.state;

        let str = '总屋名称,' + detail.name
        //`${topname}\n${housename}\n产品类型,高,宽,深度,单价,数量,总价,单位,立面说明,门板材质/柜体材质\n`
        const jsonData = []
        let total = 0;
        let totalcount = 0;
        // <td className="tconter">{((Number(x.height)* Number(x.width))/1000000).toFixed(2)}</td>
        //                                    <td className="tconter">{(Number(x.singleprice)* (((Number(x.height)* Number(x.width))/1000000).toFixed(2))).toFixed(2)}</td>

        console.log(exportlist, 'exportlistexportlist');
        exportlist.forEach(x => {
            str += `\n房间名称,${x.name}\n产品类型,高,宽,深度,数量,单位,单价,总价,立面说明,门板/柜体材质\n`
            x.items.filter(x => { return x.type == 'CP' }).forEach(y => {
                str += `${y.cname},${y.height},${y.width},${y.deep},${y.count},${y.unit},${y.singleprice},${(Number(y.count) * Number(y.singleprice)).toFixed(2)},${y.lmsm},${y.cname1}\n`
            })
            str += `,,,平方总计,${x.cptotalcount},,金额合计,${x.cptotal}\n\n`

            str += `五金类型,高,宽,深度,数量,单位,单价,总价,立面说明,五金材质\n`
            x.items.filter(x => { return x.type == 'WJ' }).forEach(y => {
                str += `${y.cname},-,-,-,${y.count},${y.unit},${y.singleprice},${(Number(y.count) * Number(y.singleprice)).toFixed(2)},${y.lmsm},${y.cname1}\n`
            })
            str += `,,,,,,,,金额合计,${x.wjtotal}\n`
            str += `总金额,${Math.round(Number(x.cptotal) + Number(x.wjtotal))}\n`
            total = Math.round(Number(total) + Number(x.cptotal) + Number(x.wjtotal))
        })
        str += '\n\n总价合计,' + total
        let uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str);
        //通过创建a标签实现
        let link = document.createElement("a");
        link.href = uri;
        //对下载的文件命名
        link.download = name + ".csv";
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);

    }


    addroom() {
        let { selectroomid, exportlist, totalamount } = this.state;
        if (Number(selectroomid) > 0) {
            dz_getprojectitemlist(selectroomid, res => {
                if (res.issuccess == 1) {
                    let { room, wj, cp } = res;
                    let wjtotal = 0, cptotal = 0, cptotalcount = 0, wjtotalcount = 0, amount = 0
                    wj.forEach(x => {
                        wjtotal = (Number(wjtotal) + (Number(x.singleprice) * Number(x.count))).toFixed(2)
                        wjtotalcount = (Number(wjtotalcount) + Number(x.count)).toFixed(2)
                    })
                    cp.forEach(x => {
                        cptotalcount = (Number(cptotalcount) + Number(x.count)).toFixed(2)
                        cptotal = (Number(cptotal) + (Number(x.singleprice) * Number(x.count))).toFixed(2)
                    })
                    amount = (Number(wjtotal) + (Number(cptotal))).toFixed(2)
                    totalamount = (Number(totalamount) + (Number(amount))).toFixed(2)
                    let item = { room, wjtotal, cptotal, cptotalcount, wjtotalcount, amount, wj, cp }
                    console.log(item, 'item');
                    exportlist.push(item)
                    console.log(exportlist, 'exportlist');
                    this.setState({ exportlist, totalamount })
                }
            })
        }
    }

    save(exportlist) {
        let { id, input_name } = this.state;
        if (input_name == '') {
            alert('请输入业主地址')
        } else {
            let data = { name: input_name, rawData: JSON.stringify(exportlist) }
            if (Number(id) > 0) data['id'] = id
            dz_projectdetail_editdata(data, res => {
                if (res.issuccess == 1) {
                    if (Number(id) > 0) {
                    } else {
                        this.setState({ id: res.id })
                    }
                    this.setState({ exportlist })

                    //alert('保存成功')
                    // if(ismoban){
                    //     window.location.href='./dz_newroom.html?id='+res.id
                    // }
                }
            })
        }

    }

    inputchange1(eindex, prop, val, tdindex, type) {
        // if(this.state.detail.pool!='BJ') return
        var value = prompt('请输入', val)
        console.log('inputchange1', { eindex, prop, val });
        if (value != val && value != '' && value != null) {
            let { exportlist } = this.state
            exportlist[eindex]['items'][type][tdindex][prop] = value
            this.setState({ exportlist }, () => {
                this.save(exportlist)
            })
            // if (id == -1) {
            //     //自定义内容
            //     console.log('自定义内容', { eindex, prop, val, tdindex });
            //     if (wjval == 'wj') {
            //         tdindex += exportlist[eindex]['items'].filter(x => { return x.type == 'CP' }).length
            //         // console.log(cpcount,'cpcountcpcount');
            //         //  exportlist[eindex]['items'][tdindex+cpcount][prop] = value
            //     }

            //     exportlist[eindex]['items'][tdindex][prop] = value

            // } else {
            //     let index = exportlist[eindex]['items'].findIndex(x => { return x.id == id })
            //     exportlist[eindex]['items'][index][prop] = value;
            // }


        }
    }

    // inputmobanchange1(prop, t, index, val) {

    //     // if(this.state.detail.pool!='BJ') return
    //     var value = prompt('请输入', val), { moban } = this.state
    //     if (value != val && value != '') {
    //         let tval = t == 0 ? 'cp' : 'wj'
    //         moban[tval][index][prop] = value;
    //         //  let {exportlist} = this.state,index = exportlist[eindex]['items'].findIndex(x=>{return x.id==id})
    //         this.setState({ moban })
    //     }
    // }




    selectfang(e) {
        console.log(e.target.value, 'edddd');
        let sel_fang = e.target.value
        this.setState({ sel_fang })
    }

    addfangjian() {
        let { sel_fang, exportlist, input_name } = this.state;
        console.log(sel_fang, 'sel_fang');
        if (input_name == '') {
            alert('请输入业主地址')
        } else {
            dz_getroombyid(sel_fang, res => {
                if (res.issuccess == 1) {
                    let { data } = res, rawData = JSON.parse(decodeurl(data.rawData))
                    let cptotalcount = 0, cptotal = 0, wjtotal = 0, roomdata = { items: { cp: [], wj: [] } };
                    roomdata['name'] = rawData.name
                    // console.log(rawData,'rawDatarawData');

                    rawData.items.cp.forEach(x => {

                        roomdata['items']['cp'].push(x)
                        cptotalcount += Number(x.count)
                        cptotal += (Number(x.count) * Number(x.singleprice))

                    })

                    rawData.items.wj.forEach(x => {
                        roomdata['items']['wj'].push(x)
                        wjtotal += (Number(x.count) * Number(x.singleprice))
                    })


                    roomdata['cptotalcount'] = Number(cptotalcount).toFixed(2)
                    roomdata['cptotal'] = Number(cptotal).toFixed(2)
                    roomdata['wjtotal'] = Number(wjtotal).toFixed(2)
                    roomdata['amount'] = (Number(wjtotal) + Number(cptotal)).toFixed(2)
                    exportlist.push(roomdata)
                    this.setState({ exportlist })
                    this.save(exportlist)

                }

                // if (list.length > 0) {
                //     let roomdata = {items:{cp:[],wj:[]}}

                //     list.forEach(item => {

                //         data['name'] = item.name
                //         item.items.forEach(x => {
                //             if (x.type == 'CP') {
                //                 data['items']['cp'].push(x)
                //                 cptotalcount += Number(x.count)
                //                 cptotal += (Number(x.count) * Number(x.singleprice))
                //             } else {
                //                 data['items']['wj'].push(x)
                //                 wjtotal += (Number(x.count) * Number(x.singleprice))
                //             }
                //         })
                //         data['cptotalcount'] = Number(cptotalcount).toFixed(2)
                //         data['cptotal'] = Number(cptotal).toFixed(2)
                //         data['wjtotal'] = Number(wjtotal).toFixed(2)
                //         data['amount'] = (Number(wjtotal) + Number(cptotal)).toFixed(2)
                //         //  totalamount+=Number(wjtotal)+Number(cptotal)
                //         exportlist.push(data)
                //     })

                //     console.log(exportlist, 'addfangjian');


                // }
            })
        }
    }



    changeroomname(index, def) {
        var value = prompt('请输入', def)
        // console.log('inputchange1', { eindex, prop, val });
        if (value != def && value != '' && value != null) {
            let { exportlist } = this.state
            exportlist[index]['name'] = value
            this.setState({ exportlist })
            this.save(exportlist)
        }
    }
   

    render() {
        var { showpage1,input_name, sel_fang,showpage, fangjianhtml, moban, cate_MBXHhtml,cate_LSFShtml,cate_GTXHhtml,showmoban, input_mbname, detail, name, exportlist, totalamount, cate_WJLBhtml, roomhtml, selectroomid, cate_GTCZhtml } = this.state;
        console.log({exportlist,input_name}, 'exportlist');
     
        return (

            <div className="breadLinebox">
                <div>
                {/* <div style={{display:showpage?'none':''}} className="selfang">
                <p onClick={()=>{window.location.href='./dz_main.html'}} className="btn">返回</p>
                </div> */}
                <div className="wrap">
                    <div className='input_name'>{input_name}</div>

                    {
                        exportlist.map((ex,ei)=>{
                            return(
                                <div className="item">
                                    <p>{ex.name}</p>
                                     <div  className="d1">
                                        {
                                           // let mbxhlist =  ex.items.cp.filter(x=>{x.type=='MBXH'});

                                            ex.items.cp.map((ix,ii)=>{
                                                return(
                                                    <div style={{display:ix.MBXHname||ix.GTXHname?'':'none'}} className="dd1">
                                                        <div className='cname'>{ix.cname}</div>
                                                        <div className='ddgroup'>
                                                        <div className="dd2">
                                                            <div className="dd">
                                                                <div className="topp">
                                                            <p>门板型号</p>
                                                            <p>{ix.MBXHname||'-'}</p>
                                                                </div>
                                                                <img src={ ix.MBXHsrc?  (IMGSOURCE+ix.MBXHsrc):'./src/white.png'} alt=""  />
                                                            </div>
                                                        </div>
                                                        <div className="dd2">
                                                            <div className="dd">
                                                                <div className="topp">
                                                            <p>柜体型号</p>
                                                            <p>{ix.GTXHname||'-'}</p>
                                                                </div>
                                                                <img  src={ ix.GTXHsrc? IMGSOURCE+ix.GTXHsrc:'./src/white.png'} alt=""  />
                                                            </div>
                                                        </div>
                                                        </div>
                                                    </div>
                                                )
                                            })
                                        }
                                        
                                        
                                     </div>


                                </div>
                            )
                        })
                    }


                </div>
              
                </div>

            </div >


        )
    }
}





ReactDOM.render(
    <div>
        {/* <LeftMenu code='0' /> */}
        <FirstPage />
    </div>
    //<Barrage/>
    , $('.container')[0]
)